/*
 * Common functions
 */
accountingIntegrationDashboardApp.service('commonUtilService', function($http) {
	
	return {
		getComboSelectedValue : function (comboBox) {
			return comboBox.options[comboBox.selectedIndex].value;
		},
		
		getRadioSelectedValue : function (radioElements) {
			var result = null;
			for(var i= 0; i < radioElements.length; i++) {
				if (radioElements[i].checked) {
					result = radioElements[i].value;
					break;
				}
			}
			return result;
		},
		
		isUndefinedOrNull: function(obj) {
			return !angular.isDefined(obj) || obj===null;
	    }
	};
	
});